package com.fance.service;

import com.fance.dao.MessageDAO;
import com.fance.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fance
 * @date 18-5-9 上午10:58
 */
@Service
public class MessageService {

    @Autowired
    MessageDAO messageDAO;


    public int addMessage(Message message) {
        return messageDAO.addMessage(message);
    }

    public List<Message> getConversationDetail(String conversationId,int offset, int limit) {
        return messageDAO.getConversationDetail(conversationId,offset,limit);
    }
    public List<Message> getConversationList(int userId,int offset, int limit) {
        return messageDAO.getConversationList(userId,offset,limit);
    }

    public int getConversationUnreadCount(int userId, String conversationId) {
        return messageDAO.getConversationUnReadCount(userId,conversationId);
    }


}
